const path = require('path')
const webpack = require('webpack')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const MiniCssExtractPlugin = require('mini-css-extract-plugin')

module.exports = {
    mode: "none",
    entry: './src/main.js',
    output: {
        filename: 'bundle.js',
        path: path.join(__dirname, 'dist'),
    },
    module: {
        rules: [
            {
                test: /\.css$/,
                use: [
                    // 'style-loader', // style标签到页面
                    MiniCssExtractPlugin.loader, //MiniCssExtractPlugin插件内置loader,使用link
                    'css-loader'
                ]
            }
        ]
    },
    plugins:[  
        new HtmlWebpackPlugin(),
        new MiniCssExtractPlugin(),
    ]
}